home *** CD-ROM | disk | FTP | other *** search
/ The Utilities Experience / The Utilities Experience - Volume 1.iso / software / graphics / h-m / ie / arexx / zoomblur.rexx < prev   
OS/2 REXX Batch file  |  1995-12-21  |  2KB  |  84 lines

  1. /*******************************/
  2. /* Image Engineer Macro script */
  3. /* by Simon Edwards            */
  4. /* 4/6/95                      */
  5. /*                             */
  6. /* This creates a sort of zoom */
  7. /* motion blur effect.         */
  8. /*******************************/
  9.  
  10. Options results
  11. signal on error            /* Setup a place for errors to go */
  12.  
  13. if arg()==0 then exit
  14.  
  15. PROJECT_INFO arg(1) WIDTH
  16. sourcewidth=RESULT
  17. PROJECT_INFO arg(1) HEIGHT
  18. sourceheight=RESULT
  19.  
  20. 'REQUEST "Number of pixels to blur by" "1|2|4|8|16|32|64"'
  21. reply=RESULT
  22.  
  23. if reply=0 then times=6
  24. else times=reply-1
  25.  
  26. stepsize=2
  27.  
  28. 'REQUEST "Method to use" "Blur|Max|Min"'
  29. reply=RESULT
  30.  
  31. select
  32.     when reply=1 then method="MIX 50"
  33.     when reply=2 then method="MAX"
  34.     when reply=0 then method="MIN"
  35. end
  36.  
  37. SCALE arg(1) sourcewidth+stepsize sourceheight+stepsize BEST
  38. temp=RESULT
  39.  
  40. MARK temp PRIMARY
  41. MARK arg(1) SECONDARY
  42. COMPOSITE (sourcewidth-sourcewidth-stepsize)/2 (sourceheight-sourceheight-stepsize)/2 method
  43. temp2=RESULT
  44. CLOSE temp
  45.  
  46. stepsize=stepsize*2
  47.  
  48. do while times~=0
  49.  
  50.     SCALE temp2 sourcewidth+stepsize sourceheight+stepsize BEST
  51.     temp=RESULT
  52.     
  53.     MARK temp PRIMARY
  54.     MARK temp2 SECONDARY
  55.     COMPOSITE (sourcewidth-sourcewidth-stepsize)/2 (sourceheight-sourceheight-stepsize)/2 method
  56.     temp3=RESULT
  57.     CLOSE temp2
  58.     CLOSE temp
  59.  
  60.     temp2=temp3
  61.     stepsize=stepsize*2
  62.     times=times-1
  63. end
  64.  
  65. exit
  66.  
  67. /*******************************************************************/
  68. /* This is where control goes when an error code is returned by IE */
  69. /* It puts up a message saying what happened and on which line     */
  70. /*******************************************************************/
  71. error:
  72. if RC=5 then do            /* Did the user just cancel us? */
  73.     IE_TO_FRONT
  74.     LAST_ERROR
  75.     'REQUEST "'||RESULT||'"'
  76.     exit
  77. end
  78. else do
  79.     IE_TO_FRONT
  80.     LAST_ERROR
  81.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  82.     exit
  83. end
  84.